package com.hejia.alauda.entity;

import java.util.Date;

import org.codehaus.jackson.annotate.JsonIgnoreProperties;

/**
 * 启动画面
 * 
 * @author hyr
 *
 */
@JsonIgnoreProperties(value = { "code" })
public class SplashScreen {

	private String os; // 手机操作系统
	private String fileName; // 唯一图片文件名称，便于客户端识别
	private String url; // 图片地址
	private Integer width; // 宽分辨率（单位像素）
	private Integer height; // 高分辨率（单位像素）
	private Integer dpi; // 每英寸所打印的点数
	private Date startTime; // 开始时间
	private Date endTime; // 结束时间

	public String getOs() {
		return os;
	}

	public void setOs(String os) {
		this.os = os;
	}

	public String getFileName() {
		return fileName;
	}

	public void setFileName(String fileName) {
		this.fileName = fileName;
	}

	public String getUrl() {
		return url;
	}

	public void setUrl(String url) {
		this.url = url;
	}

	public Integer getWidth() {
		if (this.width == null) {
			return 0;
		}
		return width;
	}

	public void setWidth(Integer width) {
		this.width = width;
	}

	public Integer getHeight() {
		if (this.height == null) {
			return 0;
		}
		return height;
	}

	public void setHeight(Integer height) {
		this.height = height;
	}

	public Integer getDpi() {
		if (this.dpi == null) {
			return 0;
		}
		return dpi;
	}

	public void setDpi(Integer dpi) {
		this.dpi = dpi;
	}

	public Date getStartTime() {
		return startTime;
	}

	public void setStartTime(Date startTime) {
		this.startTime = startTime;
	}

	public Date getEndTime() {
		return endTime;
	}

	public void setEndTime(Date endTime) {
		this.endTime = endTime;
	}

	/**
	 * 获取编码
	 * @return 编码
	 */
	public String getCode() {
		
		return String.format("%s_%s_%s_%s", 
				this.getOs(), 
				this.getWidth(), 
				this.getHeight(),
				this.getDpi());
	}
}
